<script lang="ts" setup>
import Mock from 'mockjs'
import { ref } from 'vue'

const requstConfig = {
  url: '/getSowTypeSelect',
  mockData: () => {
    return Mock.mock({
      code: 0,
      'data|3-5': [
        {
          name: '@cname',
          'id|+1': 1
        }
      ]
    })
  },
  formatResponse: res => {
    return res.data
  }
}

const value = ref<string>()
</script>

<template>
  <AsyncSelect
    v-bind="$attrs"
    v-model="value"
    :request-config="requstConfig"
    label-prop="name"
    value-prop="id"
  >
  </AsyncSelect>
</template>
